Skip to content

Fix AWSCRTHTTPClient request bodies for HTTP/1.1 connections#697

Open
arandito wants to merge 1 commit into
smithy-lang:developfrom
arandito:fix-crt-h1-services
Open

Fix AWSCRTHTTPClient request bodies for HTTP/1.1 connections#697
arandito wants to merge 1 commit into
smithy-lang:developfrom
arandito:fix-crt-h1-services

Conversation

@arandito
Copy link
Copy Markdown
Contributor

@arandito arandito commented May 13, 2026

Description

Previously, our AWSCRTHTTPClient attached request bodies via the CRT's request_body_generator parameter, which is only supported for HTTP/2 connections (source). This caused generated clients that only support HTTP/1.1 to throw the following error when making body-bearing requests:

smithy_core.exceptions.SmithyError: 2056 (AWS_ERROR_HTTP_MISSING_BODY_STREAM): Given the provided headers (ex: Content-Length), a body is expected.

This PR adds logic that routes HTTP/1.1 connections to attach bodies through the body_stream parameter on the request itself and keeps the generator path for HTTP/2.

Testing

  • Generated H1-only service (STS) and confirmed calls no longer raise AWS_ERROR_HTTP_MISSING_BODY_STREAM
  • Confirmed existing client integration tests succeed with changes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@arandito arandito requested a review from a team as a code owner May 13, 2026 23:03
@arandito arandito changed the title smithy-http: Fix AWSCRTHTTPClient request bodies for HTTP/1.1 connections Fix AWSCRTHTTPClient request bodies for HTTP/1.1 connections May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant